package bs

import scala.xml.NodeSeq
import net.liftweb.http.Templates
import net.liftweb._
import http._
import util._
import Helpers._

case class Modal(title: String, body: NodeSeq, submitter: NodeSeq) extends LiftComponent {
  val template: NodeSeq = Templates("templates-hidden" :: "bs" :: "_modal" :: Nil).get

  override def transformer: (NodeSeq) => NodeSeq =
    ".modal [id]" #> s"modal-${(math.random * 100).toInt}" &
      "h3 *" #> title &
      ".modal-body" #> body &
      ".modal-footer" #> {
        "btn-primary" #> submitter
      }
}
